// 菜单路由，存放左侧菜单

// 公用路由, 项目初始存在路由
import Layout from '@/layout'

export const routes = [
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/index'),
        hidden: true
    },
    {
        path: '/',
        name: 'index',
        component: Layout,
        redirect: '/homePage',
        children: [{
            path: 'homePage',
            name: 'HomePage',
            component: () => import('@/views/myToDo/index'),
            meta: { title: '首页', icon: 'el-icon-s-home' }
        },
        {
            path: '/404',
            name: '404',
            component: () => import('@/views/404'),
            hidden: true
        },
        {
            path: '/myToDo',
            name: 'myToDo',
            component: () => import('@/views/myToDo/index'),
            meta: { title: '我的待办', icon: 'el-icon-s-home' }
        },
        ]
    },
    {
        path: '/myArticle',
        name: 'MyArticle',
        component: Layout,
        redirect: '/myArticle/myArticleList',
        meta: { title: '我的活动', icon: 'el-icon-s-promotion' },
        children: [
            {
                path: 'myArticleList',
                name: 'MyArticleList',
                component: () => import('@/views/myArticle/myArticleList'),
                meta: { title: '我的活动', icon: 'el-icon-s-data' }
            },
            {
                path: 'myApplyList',
                name: 'MyApplyList',
                component: () => import('@/views/myArticle/myApplyList'),
                meta: { title: '我的申请', icon: 'nested' }
            }
        ]
    },
    {
        path: '/article',
        name: 'Article',
        component: Layout,
        redirect: '/article/articleList',
        meta: { title: '活动信息', icon: 'el-icon-s-help' },
        children: [
            {
                path: 'articleList',
                name: 'ArticleList',
                component: () => import('@/views/article/articleList/index'),
                meta: { title: '活动列表', icon: 'table' }
            },
            {
                path: 'applyList',
                name: 'ApplyList',
                component: () => import('@/views/article/articleApplyList/index'),
                meta: { title: '申请列表', icon: 'nested' }
            }
        ]
    },
    {
        path: '/userManage',
        name: 'UserManage',
        component: Layout,
        redirect: '/userManage/userList',
        meta: { title: '用户管理', icon: 'el-icon-user-solid' },
        children: [
            {
                path: 'userList',
                name: 'UserList',
                component: () => import('@/views/userManage/userList/index'),
                meta: { title: '用户列表', icon: 'el-icon-user-solid' }
            },
            {
                path: 'roleList',
                name: 'RoleList',
                component: () => import('@/views/userManage/roleList/index'),
                meta: { title: '角色列表', icon: 'el-icon-view' }
            },
        ]
    },
    {
        path: '/form',
        component: Layout,
        children: [
            {
                path: 'index',
                name: 'Form',
                component: () => import('@/views/form/index'),
                meta: { title: 'Form', icon: 'form' }
            }
        ]
    },
    {
        path: '/icon',
        component: Layout,
        children: [
            {
                path: 'index',
                component: () => import('@/views/icons/index'),
                name: 'Icons',
                meta: { title: 'Icons', icon: 'icon', noCache: true }
            }
        ]
    },
    {
        path: '/test',
        component: Layout,
        children: [
            {
                path: 'index',
                component: () => import('@/views/test/test.vue'),
                name: '测试',
                meta: { title: '测试', icon: 'icon', noCache: true }
            }
        ]
    },

    // 404 page must be placed at the end !!!
    { path: '*', redirect: '/404', hidden: true }
]

export default routes